import {
  LEAVE_LIST,
  LEAVE_UPDATE
} from '../reducersTypes'

import {
  fetchLeaveList,
  fetchLeaveUpdate
} from '@/api/fetchAttend'

const handleAttendList = data => {
  return dispatch => {
    fetchLeaveList(data).then(res => {
      // console.log(res);
      dispatch({type: LEAVE_LIST, payload: res.data})
    })
  }
}
const handleAttendUpdate = data => {
  return dispatch => {
    fetchLeaveUpdate(data).then(res => {
      console.log(res);
      dispatch({type: LEAVE_UPDATE, payload: res.data})
    })
  }
}
export {
  handleAttendList,
  handleAttendUpdate
}